{% extends 'base.html' %}

{% load static %}
 {% block title %}地址管理{% endblock %}
{% block header %}
    <script src="{% static '/assets/js/jquery.min.js'%}" type="text/javascript"></script>
    <script src={% static '/js/user.js' %}> </script>

		<script src="{% static '/assets/js/amazeui.js'%}"></script>
    <style>

    </style>
{% endblock %}

{% block content %}
    {% csrf_token %}

    <div class="Bott">
			<div class="wrapper clearfix" style="margin: 0 auto">
				<div class="zuo fl" style="margin-left: 100px">
					<h3>
						<a href="/"><img src="/{{ user.img }}" width="100px" height="100px"></a>
						<p class="clearfix"><span class="fl" style="font-size: 15px; margin-left: -12px">[{{ user.email }}]</span>
                            <a href="/user/logout/"><span class="fr logout" style="font-size: 15px;">[退出登录]</span></a>
                        </p>
					</h3>
					<div>
            <ul>
                <li><a href="/user/usercenter/">个人信息</a></li>
            </ul>
            <ul>
				<li><a href="/user/mypassword/">修改密码</a></li>
			</ul>
            <ul>
                <li><a href="/user/myorder/">我的订单</a></li>
            </ul>
            <ul>
                <li><a href="/user/address/">地址管理</a></li>
            </ul>
            <ul>
                <li><a href="/">回到首页</a></li>
            </ul>

					</div>
				</div>
				<div class="you fl" style="height: 710px;">
					<div class="user-address">
						<!--标题 -->
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单管理</strong> </div>
						</div>
						<hr/>

					<div class="clear">
                          <ul style="width:100%;height: 600px;overflow-y: auto">
        {% for order in order_list %}
            <li>
                <h2>订单号: {{ order.uuid }}</h2>
                <p>总价: {{ order.sum }}</p>
                <p>状态: {{ order.status }}</p>
                <p>用户: {{ user.name }}</p>  <!-- 假设 User 模型有 username 字段 -->
                <a href="/user/deleteorder/{{ order.id }}/">删除</a>
                <h3>订单项:</h3>
                <ul>
                    {% for item in order.orderitem_set.all %}
                        <li>
                            <img src="/{{ item.order_img}}" alt="{{ item.order_name }}" width="100">
                            <p>名称: {{ item.order_name }}</p>
                            <p>价格: {{ item.order_price }}</p>
                            <p>数量: {{ item.order_count }}</p>

                        </li>
                    {% endfor %}
                </ul>
            </li>
         {% endfor %}
    </ul>

                    </div>

				</div>

            </div>


            </div>
    </div>

    <script src="{% static  '/vendor/bootstrap/js/bootstrap.bundle.js' %}"></script>
{% endblock %}

